let OSS = require('ali-oss')

let aliOss = new OSS({
  region: 'oss-cn-beijing',
  accessKeyId: 'LTAI5tG8fVAQBq3Ha1uhvbZn',
  accessKeySecret: 'hEUEmPwuWydtL4iB2JgWh1YO6cmdEy',
  bucket: 'hixicasting'
})
const headers = {
  'x-oss-forbid-overwrite': true
}

export const put = async (ObjName, fileUrl) => {
  try {
    let result = await aliOss.put(`${ObjName}`, fileUrl)
    return result
  } catch (e) {
    console.log(e)
  }
}


export const getFile = async (ObjName) => {
  try {
    let result = await aliOss.signatureUrl(`${ObjName}`)
    return result
  } catch (e) {
    console.log(e)
  }
}